<template>
  <div class="app">
     <Myheader @submit="add"/>
     <Mycon :list="list"/>
  </div>
</template>

<script>
import Myheader from "./components/Myheader.vue"
import Mycon from "./components/Mycon.vue"
export default {
    data(){
        //存放数据
        return{
            list:[]
        }
    },
    methods:{
        //存放函数
        add(text){
            this.list.push({
                id:Date.now(),
                text
            })
        }
    },
    components:{
        // 注册组件
        Myheader,
        Mycon
    },

    
}
</script>

<style>

</style>